<template>
  <div class="navigation-bar">
    <div class="brief-title">
      <span>导航栏</span>
    </div>
<!--    <div v-if="menu" class="boxs">-->
<!--      <div class="box"-->
<!--           v-for="(item, index) in menu"-->
<!--           :key="index"-->
<!--           :class="item.code"-->
<!--      >-->
<!--        <div class="nav-title-group">-->
<!--          <div class="nav-line"></div>-->
<!--          <div class="nav-title">{{ item.name }}</div>-->
<!--        </div>-->
<!--        <div class="nav-container">-->
<!--          <div-->
<!--            v-for="(_item, _index) in item.children"-->
<!--            :key="_index"-->
<!--            class="nav-wrapper"-->
<!--          >-->
<!--            <div-->
<!--              v-for="(item, index) in _item.children"-->
<!--              :key="index"-->
<!--              :class="item.noMenu ? 'nav-item active' : 'nav-item'"-->
<!--              @click="item && item.path ? toLink(item.path) : ''"-->
<!--            >-->
<!--              {{ item.name }}-->
<!--            </div>-->
<!--          </div>-->
<!--        </div>-->
<!--      </div>-->
<!--    </div>-->
    <div >
      <div
        v-for="(item, index) in navbars"
        :key="index"
        :class="item.class"
      >
        <div class="nav-title-group">
          <div class="nav-line"></div>
          <div class="nav-title">{{ item.title }}</div>
        </div>
        <div class="nav-container">
          <div
            v-for="(_item, _index) in item.navs"
            :key="_index"
            class="nav-wrapper"
          >
            <div
              v-for="(item, index) in _item"
              :key="index"
              :class="item.noMenu ? 'nav-item active' : 'nav-item'"
              @click="item && item.url ? toLink(item.path) : ''"
            >
              {{ item.name }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {mapGetters} from "vuex";

export default {
  name: "navigation",
  props: ['navbars'],
  data() {
    return {
      navbarlist: '',
      isMenu: false,
      menu:''
    }
  },
  created() {
  },
  mounted() {
    console.log(this.navbars)
  },
  methods: {
    toLink(url) {
      if(url!=='/'){
        this.$router.push(url);
      }

    }
  },
  computed: {
    // ...mapGetters(["menu"]),
  },//计算属性
}
</script>

